package gui2.g2;

import java.util.ArrayList;
import java.util.List;

public class ChatModel {

	List<String> messages = new ArrayList<String>();
	
	List<ChatModelListener> listeners = new ArrayList<ChatModelListener>();
	
	public void addChatModelListener(ChatModelListener l){
		listeners.add(l);
	}
	
	public void addMessage(String s){
		messages.add(s);
		for(ChatModelListener l : listeners){
			l.messageAdded(s);
		}
	}
	
	
}
